#include "myevent.h"
#include "ui_myevent.h"
#include <QDebug>
#include <QMouseEvent>
MyEvent::MyEvent(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MyEvent)
{
    ui->setupUi(this);
}

MyEvent::~MyEvent()
{
    delete ui;
}

bool MyEvent::event(QEvent *event)
{
    static int i = 0;
    //qDebug()<<i++;
    return QWidget::event(event);

}

void MyEvent::mousePressEvent(QMouseEvent *event)
{
    qDebug()<<event->pos();
}

void MyEvent::mouseDoubleClickEvent(QMouseEvent *event)
{
    //双击全屏
    if(this->isFullScreen())
        this->showNormal();  //正常显示
    else{
        this->showFullScreen();  //全屏显示
    }

}
